package ac.you.api.command.t;

public class LimitParam {
    private final String[] limitparam;
    private final String[] ali;

    public LimitParam(String[] limitparam, String[] ali) {
        this.limitparam = limitparam;
        this.ali = ali;
    }

    public LimitParam(String[] limitparam) {
        this(limitparam,null);
    }
    public boolean match(String c,int args){
        if (limitparam != null && limitparam.length > 0 && limitparam.length - 1 >= args) return limitparam[args].equals(c) || (ali != null && ali.length <= limitparam.length && ali[args].equals(c));
        return false;
    }
    public static LimitParam build(String[] limitparam, String[] ali){
        return new LimitParam(limitparam,ali);
    }
    public static LimitParam build(String[] limitparam){
        return build(limitparam,null);
    }

}
